package org.jeecg.modules.manager.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.text.DecimalFormat;

/**
 * @author wenhao hu
 * @title: SaleQueryByIdVo
 * @projectName biyesheji
 * @description: TODO
 * @date 2021/12/521:31
 */
@Data
public class SaleQueryByIdVo{

    /**主键*/
    @TableId
    @Excel(name = "销售订单主键", width = 15)
    @ApiModelProperty(value = "主键")
    private java.lang.String saleOrderId;

    @Excel(name = "订单组主键", width = 15)
    @ApiModelProperty(value = "订单组主键")
    private String orderGroupId;

    /**商品主键*/
    @Excel(name = "商品主键", width = 15)
    @ApiModelProperty(value = "商品主键")
    private java.lang.String saleOrderGoodsId;

    @ApiModelProperty(value = "商品名")
    private String saleOrderGoodsName;

    /**客户主键*/
    @Excel(name = "客户主键", width = 15)
    @ApiModelProperty(value = "客户主键")
    private java.lang.String saleOrderUserId;

    @ApiModelProperty(value = "客户真实姓名")
    private String saleOrderUserRealName;
    /**仓库主键*/
    @Excel(name = "仓库主键", width = 15)
    @ApiModelProperty(value = "仓库主键")
    private java.lang.String saleOrderRepoId;

    @ApiModelProperty(value = "仓库名")
    private java.lang.String saleOrderRepoName;

    /**订单号*/
    @Excel(name = "订单号", width = 15)
    @ApiModelProperty(value = "订单号")
    private java.lang.String saleOrderNumber;
    /**销售数量*/
    @Excel(name = "销售数量", width = 15)
    @ApiModelProperty(value = "销售数量")
    private java.lang.Integer saleOrderCount;
    /**单价*/
    @Excel(name = "单价", width = 15)
    @ApiModelProperty(value = "单价")
    private String saleOrderPrice;
    /**总价*/
    @Excel(name = "总价", width = 15)
    @ApiModelProperty(value = "总价")
    private String saleOrderTotal;
    /**订单状态(0:下单 1:确认收货 2:退货)*/
    @Excel(name = "订单状态(0:下单 1:确认收货 2:退货)", width = 15)
    @ApiModelProperty(value = "订单状态(0:下单 1:确认收货 2:退货)")
    private java.lang.Integer saleOrderStatus;
    /**描述*/
    @Excel(name = "描述", width = 15)
    @ApiModelProperty(value = "描述")
    private java.lang.String saleOrderDescription;

    public static SaleQueryByIdVo makeVo(SaleOrder order){
        SaleQueryByIdVo vo = new SaleQueryByIdVo();
        vo.setSaleOrderId(order.getSaleOrderId());
        vo.setSaleOrderCount(order.getSaleOrderCount());
        vo.setSaleOrderDescription(order.getSaleOrderDescription());
        vo.setSaleOrderGoodsId(order.getSaleOrderGoodsId());
        vo.setSaleOrderPrice(new DecimalFormat("#.00").format(order.getSaleOrderPrice()));
        vo.setSaleOrderTotal(new DecimalFormat("#.00").format(order.getSaleOrderTotal()));
        vo.setOrderGroupId(order.getSaleOrderUserId());
        vo.setSaleOrderUserId(order.getSaleOrderUserId());
        vo.setSaleOrderRepoId(order.getSaleOrderRepoId());
        vo.setSaleOrderStatus(order.getSaleOrderStatus());
        return vo;
    }
}
